package service.xml;

import java.util.List;

/*
 * Html_Rep
 *
 * Descripción: Esta clase retorna el html de la tabla años del reporte
 *
 * Autor: Erik
 *
 * Versión: 0.1
 *
 * Fecha: 01/04/14
 *
 */
public class Html_Rep {

    public Html_Rep() {
    }

    public StringBuilder tableanio(
            List<Object[]> list // la data
            ) {
        StringBuilder result = new StringBuilder();
        if (list != null) {
            result.append("    <table width=\"100%\" border=\"1\">");
            for (int fil = 0; fil < list.size(); fil++) {
                result.append("<tr>");
                Object[] fila = (Object[]) list.get(fil);
                String anio = fila[0].toString();
                result.append("<td><div align=\"right\">A&ntilde;o ").append(anio).append(":</div></td>");
                result.append("<td> <input name=\"js_delhis\" type=\"checkbox\" value=\"").append(anio).append("\" /></td>");
                result.append("</tr>");
            }
            result.append(" </table>");
        }

        return result;
    }

    public StringBuilder tablecolum(
            List<Object[]> list // la data
            ) {
        StringBuilder result = new StringBuilder();
        if (list != null) {
            result.append("    <table width=\"100%\" border=\"1\">");
            for (int fil = 0; fil < list.size(); fil++) {
                result.append("<tr>");
                Object[] fila = (Object[]) list.get(fil);
                String colum = fila[0].toString();
                String item = fila[1].toString();
                result.append("<td width=\"49%\" align=\"right\" > ").append(colum.replace('_',' ')).append(":</td>");
                result.append("<td width=\"1px\"> <input name=\"js_delpro\" type=\"checkbox\" value=\"").append(colum).append(";").append(item).append("\" /></td>");
                result.append("<td width=\"49%\" align=\"left\"> ").append(item).append("</td>");
                result.append("</tr>");
            }
            result.append("<tr>");
            result.append("<td align=\"right\">PRONOSTICO:</td>");
            result.append("<td> <input name=\"js_delprodef\" type=\"checkbox\" value=\"0\" checked=\"checked\" disabled=\"disabled\"/></td>");
            result.append("<td align=\"left\"> ").append("</td>");
            result.append("</tr>");
            result.append("<tr>");
            result.append(" <td  align=\"right\">DÍA:</td>");
            result.append("<td> <input name=\"js_delprodef\" type=\"checkbox\" value=\"0\" checked=\"checked\" disabled=\"disabled\" /></td>");
            result.append("<td align=\"left\"> ").append("</td>");
            result.append("</tr>");
            result.append("<tr>");
            result.append("<td align=\"right\">SEMANA:</td>");
            result.append("<td> <input name=\"js_delprodef\" type=\"checkbox\" value=\"0\" checked=\"checked\" disabled=\"disabled\" /></td>");
            result.append("<td align=\"left\"> ").append("</td>");
            result.append("</tr>");
            result.append("<tr>");
            result.append("<td  align=\"right\">A&Ntilde;O:</td>");
            result.append("<td> <input name=\"js_delprodef\" type=\"checkbox\" value=\"0\" checked=\"checked\" disabled=\"disabled\" /></td>");
            result.append("<td align=\"left\"> ").append("</td>");
            result.append("</tr>");
            result.append(" </table>");
        }

        return result;
    }
}
